package com.example.yingjiguanli_demo.controller;

import com.example.yingjiguanli_demo.aspect.interfaces.RateLimiter;
import com.example.yingjiguanli_demo.aspect.interfaces.RequirePermission;
import com.example.yingjiguanli_demo.pojo.LoginLog;
import com.example.yingjiguanli_demo.pojo.Result;
import com.example.yingjiguanli_demo.service.ILoginLogService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author scj
 * @since 2024-11-14
 */
@RestController
@RequestMapping("/api/v1/loginLog")
public class LoginLogController {

    @Autowired
    private ILoginLogService loginLogService;

    /***
     * 获取登录日志列表
     * @return Result<List<LoginLog>>
     */
    @ApiOperation(value = "获取登录日志列表")
    @RequirePermission("admin")
    @GetMapping("/getAll")
    public Result<List<LoginLog>> getLoginLogList(){
        return loginLogService.getLoginLogList();
    }

}
